package com.lyz.dataStructure.dome;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 11:14
 * @Description:
 **/

import com.sun.org.apache.xerces.internal.impl.xs.SchemaNamespaceSupport;

import java.sql.SQLOutput;
import java.util.ArrayList;
import java.util.Scanner;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/7/13 11:14
 *@Description:
 **/
public class ListNode {

    int val ;
    ListNode next =null;
    public ListNode(int val){
        this.val = val;
    }
}

class ReverseListNode{

    public static ListNode ReverseList(ListNode head){
        ListNode prev =null ;
        ListNode curr =head;
        while(curr!=null){
            ListNode nextNode =curr.next;
             curr.next =prev;
             prev = curr;
              curr =nextNode;
        }
        return prev;
    }
}
